package bTree.LeetCode;

import java.util.Arrays;

public class 最大数 {
    public String largestNumber(int[] nums) {
        int length = nums.length;
        String []s = new String[length];
        for (int i = 0; i < length; i++) {
            s[i]=String.valueOf(nums[i]);
        }
        Arrays.sort(s,(o1,o2)->(o2+o1).compareTo(o1+o2));
        if(s[0].equals("0")){
            return "0";
        }
        String join = String.join("", s);
        return join;


    }
}